#include <iostream>
#include <string>

using namespace std;
class data;
class Time
{
private:
	int hour;
	int min;
	int sec;

public:
	Time()
		: hour(0), min(0), sec(0)
	{
	}
	Time(int hour, int min, int sec)
		: hour(hour), min(min), sec(sec)
	{
	}

	~Time()
	{
	}

public:
	// 显示时间
	void show_Time()
	{
		cout << this->hour << ":" << this->min << ":" << this->sec << endl;
	}
//把data类设置为Time类的友元函数， data类可以反问Timel类的公共函数。
	friend data;
};

class data
{
private:
	int year;
	int month;
	int day;

public:
	data()
		: year(0), month(0), day(0)
	{
	}
	data(int year, int month, int day)
		: year(year), month(month), day(day)
	{
	}

public:
	// 显示日期
	void show_Data()
	{
		cout << this->year << "/" << this->month << "/" << this->day << endl;
	}
};

int main(int argc, char const *argv[])
{
	//要是想在data类中访问Time类的函数，又不想继承Time类，我们可以吧data类设置为Time类的友元类
	Time T(20, 31, 14);
	data D(2025, 1, 17);
	T.show_Time();
	D.show_Data();
	return 0;
}
